<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>课程选课信息页面</title>
</head>
<body>
<h2 >课程选课成绩信息</h2>
<div>当前课程：${courseStudents.courseName}</div><hr>
<c:choose>
    <c:when test="${info=='fail'}">
        <div>目前该课程还没有人选！</div>
    </c:when>
    <c:otherwise>
        <table border="1" cellspacing="1" width="800" bgcolor="#ffd700">
            <tr>
                <th width="50px">姓名</th>
                <th width="50px">成绩</th>
            </tr>
                <%--varStatus:标识状态，id一般不写，自动动态的生成,status(index,count)--%>
            <c:forEach items="${courseStudents.map}" var="courseStudent">
                <tr align="center">
                    <td>${courseStudent.key}</td>
                    <td>${courseStudent.value}</td>
                </tr>
            </c:forEach>
        </table>
        <div>选课人数：${courseStudents.count}</div><hr>
        <div>平均分：${courseStudents.avg}</div><hr>
    </c:otherwise>
</c:choose>

<hr>
<a href="/student/getAll">回到首页</a>
</body>
</html>
